package com.sy.api;

import com.sy.PageVO;
import com.sy.ResultVO;
import com.sy.dto.OrdersPageDTO;
import com.sy.pojo.Orders;
import com.sy.service.OrdersService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @className: OrdersController
 * @author: Mr.Liu
 * @date: 2025/11/13 15:50
 * @Version: 1.0
 * @description: 订单相关接口
 */
@RestController
@RequestMapping("/orders")
@Tag(name = "订单模块")
@Slf4j
public class OrdersController {
    @Resource
    private OrdersService ordersService;
    @GetMapping("/page")
    @Operation(summary = "我的订单查询")
    public ResultVO<PageVO<Orders>> ordersPage(OrdersPageDTO ordersPageDTO){
        log.info("我的订单查询的入参:{}",ordersPageDTO);
        PageVO<Orders> ordersPageVO = ordersService.queryByPage(ordersPageDTO);
        return ResultVO.success(ordersPageVO);
    }
}
